From 60451870b1190cc2b6c1a3458ec85978ed3cbd5f Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 4 Dec 2024 17:07:47 +0800 Subject: [PATCH] shell_integration/macOS/FileProviderUIExt: Adapt FileProviderUIExt Locking to NextcloudKit 5 Signed-off-by: Claudio Cambra --- .../Locking/LockViewController.swift | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift index f7347848a..d93e2ec17 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift @@ -157,16 +157,20 @@ class LockViewController: NSViewController { return } let serverPathString = serverPath as String - let kit = NextcloudKit() - kit.setup( + let kit = NextcloudKit.shared + kit.appendSession( + account: account.ncKitAccount, + urlBase: account.serverUrl, user: account.username, - userId: account.username, + userId: account.id, password: account.password, - urlBase: account.serverUrl + userAgent: "Nextcloud-macOS/FileProviderUIExt", + nextcloudVersion: 25, + groupIdentifier: "" ) // guard let capabilities = await fetchCapabilities() else { guard let itemMetadata = await fetchItemMetadata( - itemRelativePath: serverPathString, kit: kit + itemRelativePath: serverPathString, account: account, kit: kit ) else { presentError("Could not get item metadata.") return @@ -200,7 +204,8 @@ class LockViewController: NSViewController { kit.lockUnlockFile( serverUrlFileName: serverUrlFileName, shouldLock: locking, - completion: { _, error in + account: account.ncKitAccount, + completion: { _, _, error in continuation.resume(returning: error) } ) -- 2.30.2